package com.fram.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.fram.bean.admin.android.order.request.OrderAndroidRequest;
import com.fram.bean.admin.android.order.request.ReportFormRequest;
import com.fram.bean.admin.android.order.response.OrderAndroidResponse;
import com.fram.bean.admin.android.order.response.OrderDetailAndroidResponse;
import com.fram.bean.admin.android.order.response.ReportFormResponse;
import com.fram.bean.admin.android.order.response.SalesVolumeResponse;
import com.fram.bean.admin.ordermain.request.OrderRequest;
import com.fram.bean.admin.ordermain.response.OrderResponse;
import com.fram.bean.api.circle.response.CircleResourceResponse;
import com.fram.bean.api.order.request.OrderSearchRequest;
import com.fram.bean.api.order.response.OrderDetailResponse;
import com.fram.bean.api.order.response.OrderSearchResponse;
import com.fram.bean.api.recovery.response.RecoveryApiListResponse;
import com.fram.bean.admin.ordermain.response.OrderStatusNumberResponse;
import com.fram.entity.OrderMain;

public interface OrderMainMapper {

	int deleteByPrimaryKey(Long id);

	int insert(OrderMain record);

	int insertSelective(OrderMain record);

	OrderMain selectByPrimaryKey(Long id);

	// 修改订单信息
	int updateByPrimaryKeySelective(OrderMain request);

	int updateByPrimaryKey(OrderMain record);

	/** 查询详情 **/
	OrderDetailResponse detailForApi(@Param("orderNumber") String orderNumber, @Param("orderId") Long orderId);

	OrderSearchResponse selectByPayNumber(String payNumber);

	/** 查询过期订单取消 **/
	List<OrderSearchResponse> selectForInvalidOrder();

	/** 订单列表 **/
	List<OrderSearchResponse> orderListForApi(OrderSearchRequest request);

	/** 获取用户订单每个状态的数量 **/
	List<com.fram.bean.api.order.response.OrderStatusNumberResponse> getOrderStatusNumberList(Long userId);

	/** 后台订单列表 **/
	List<com.fram.bean.admin.ordermain.response.OrderSearchResponse> selectOrderForAdmin(OrderRequest request);

	/** 后台查询订单详情 **/
	OrderResponse adminOrderDetail(@Param("id") Long id);
	
	/**android 订单详情**/
	OrderDetailAndroidResponse androidOrderDetail(Long id);
	
	List<OrderResponse> selectByRecyclable(@Param("userId") Long userId);
	/** 查询 可回收的 信息 **/
	List<RecoveryApiListResponse> selectByRecyclables(@Param("userId") Long userId);

	CircleResourceResponse circleQueryBasic(Long id);

	List<OrderStatusNumberResponse> orderStatusByDay(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("distributorId") Long distributorId);
	
	// 报表
	List<ReportFormResponse> reportForm(ReportFormRequest request);
	//首页  销售额
	SalesVolumeResponse salesVolume(Long distributorId);
	// 接单 配送 查询
	List<OrderAndroidResponse> listForAndroid(OrderAndroidRequest request);
	
}